#ifndef _POPUPUTIL_H_
#define _POPUPUTIL_H_

#include <FBase.h>
#include <FUi.h>
#include <FMedia.h>
#include <FGraphics.h>

typedef enum{
	WAITING_PROGRESS=0,
	WAITING_WITHOUT_PROGRESS,
	COMMON
}popupStyle;

typedef enum {
	NAV_ROUTE=4,
	LOAD_ROUTE,
	LOCATOR,
	GOOGLE,
	TRACK,
	NONE
}typeSearch;

class IPopupListener {
public:
	//virtual void OnShowStateChanged(bool show) = 0;
	virtual void OnUserAction(int &actionId, typeSearch& type) = 0;
};

class PopupUtil:
	public Osp::Ui::Controls::Popup
	,public Osp::Ui::IAnimationEventListener
	,public Osp::Ui::IActionEventListener
{
public:
	PopupUtil();
	~PopupUtil();
//public:
//	Osp::Ui::Controls::Progress*  __pProgress;
protected:
	static const int ID_ACTION_RESPONSE=350;
	Osp::Ui::Controls::Label*		__pLbText;
	Osp::Ui::Controls::Progress*  	__pProgress;
	IPopupListener*				 	__listener;
	Osp::Base::Collection::ArrayList* animationFrameList;
	typeSearch __type;
public:
	static void ShowMessageBox(Osp::Base::String title,Osp::Base::String text);
	static int ShowYesNoMessageBox(Osp::Base::String title,Osp::Base::String text);
	void InitWait();
	void InitWaitProgress();
	void InitCommon();
	void Initialize();
	void Initialize(popupStyle style, typeSearch type,IPopupListener &listener);
	void SetText(const Osp::Base::String& info);
	void ShowPopup();
//	result ShowPopup(int millisec);
	void SetMessage(const Osp::Base::String& text);
	void SetProgressStatus(int value);

	Osp::Graphics::Bitmap*GetBitmapN(const Osp::Base::String& name);
//	void CloseWaitingPopup(void);
public:
	void OnAnimationStopped(const Osp::Ui::Control& source){};
	void OnActionPerformed(const Osp::Ui::Control& source, int actionId);

};


#endif // _POPUPUTIL_H_
